package org.kabeja.dxf.entity;

import org.kabeja.dxf.DXFConstants;
import org.kabeja.dxf.helpers.Point;
import org.kabeja.math.MathUtils;

/**
 * @author shutao
 * @since 2022/4/25 9:07
 */
public class DXFLine extends DXFEntity {
    private Point start = new Point();
    private Point end = new Point();

    public DXFLine() {
        this.setLineType(this.getType());
    }

    public void setProperty(int var1, String var2) {
    }

    public void setStartPoint(Point var1) {
        this.start = var1;
    }

    public Point getEndPoint() {
        return this.end;
    }

    public void setEndPoint(Point var1) {
        this.end = var1;
    }

    public Point getStartPoint() {
        return this.start;
    }

    @Override
    public Bounds getBounds() {
        Bounds var1 = new Bounds();
        var1.addToBounds(this.end);
        var1.addToBounds(this.start);
        return var1;
    }

    @Override
    public String getType() {
        return DXFConstants.ENTITY_TYPE_LINE;
    }

    @Override
    public double getLength() {
        return MathUtils.distance(this.start, this.end);
    }
}
